<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
  <title>run (Spec::DSL::Example)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
  <pre><span class="ruby-comment cmt"># File vendor\plugins\rspec/lib/spec/dsl/example.rb, line 17</span>
      <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run</span>(<span class="ruby-identifier">reporter</span>, <span class="ruby-identifier">before_each_block</span>, <span class="ruby-identifier">after_each_block</span>, <span class="ruby-identifier">dry_run</span>, <span class="ruby-identifier">execution_context</span>, <span class="ruby-identifier">timeout</span>=<span class="ruby-keyword kw">nil</span>)
        <span class="ruby-ivar">@dry_run</span> = <span class="ruby-identifier">dry_run</span>
        <span class="ruby-identifier">reporter</span>.<span class="ruby-identifier">example_started</span>(<span class="ruby-keyword kw">self</span>)
        <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">reporter</span>.<span class="ruby-identifier">example_finished</span>(<span class="ruby-keyword kw">self</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">dry_run</span>

        <span class="ruby-identifier">errors</span> = []
        <span class="ruby-identifier">location</span> = <span class="ruby-keyword kw">nil</span>
        <span class="ruby-constant">Timeout</span>.<span class="ruby-identifier">timeout</span>(<span class="ruby-identifier">timeout</span>) <span class="ruby-keyword kw">do</span>
          <span class="ruby-identifier">before_each_ok</span> = <span class="ruby-identifier">before_example</span>(<span class="ruby-identifier">execution_context</span>, <span class="ruby-identifier">errors</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">before_each_block</span>)
          <span class="ruby-identifier">example_ok</span> = <span class="ruby-identifier">run_example</span>(<span class="ruby-identifier">execution_context</span>, <span class="ruby-identifier">errors</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">before_each_ok</span>
          <span class="ruby-identifier">after_each_ok</span> = <span class="ruby-identifier">after_example</span>(<span class="ruby-identifier">execution_context</span>, <span class="ruby-identifier">errors</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">after_each_block</span>)
          <span class="ruby-identifier">location</span> = <span class="ruby-identifier">failure_location</span>(<span class="ruby-identifier">before_each_ok</span>, <span class="ruby-identifier">example_ok</span>, <span class="ruby-identifier">after_each_ok</span>)
        <span class="ruby-keyword kw">end</span>

        <span class="ruby-constant">ExampleShouldRaiseHandler</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@from</span>, <span class="ruby-ivar">@options</span>).<span class="ruby-identifier">handle</span>(<span class="ruby-identifier">errors</span>)
        <span class="ruby-identifier">reporter</span>.<span class="ruby-identifier">example_finished</span>(<span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">errors</span>.<span class="ruby-identifier">first</span>, <span class="ruby-identifier">location</span>, <span class="ruby-ivar">@example_block</span>.<span class="ruby-identifier">nil?</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">reporter</span>
      <span class="ruby-keyword kw">end</span></pre>
</body>
</html>